﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Sundry.Model
{
    /// <summary>
    /// 管理员
    /// </summary>
    public class Admin
    {
        /// <summary>
        /// 管理员Id
        /// </summary>
        [Key]
        public int AdminId { get; set; }
        /// <summary>
        /// 管理员昵称
        /// </summary>
        [StringLength(10)]
        public string AdminNickName { get; set; }
        /// <summary>
        /// 用户名
        /// </summary>
        [StringLength(20)]
        public string AdminUserName { get; set; }
        /// <summary>
        /// 密码
        /// </summary>
        [StringLength(200)]
        public string AdminPassword { get; set; }
        /// <summary>
        /// 盐值
        /// </summary>
        [StringLength(10)]
        public string AdminSalt { get; set; }
        /// <summary>
        /// 权限Id（1 总管理员）
        /// </summary>
        public int AuthoryId { get; set; }
        /// <summary>
        /// 管理员创建时间
        /// </summary>
        public DateTime AdminCreateTime { get; set; }
        /// <summary>
        /// 上次登录IP
        /// </summary>
        [StringLength(50)]
        public string AdminLastLoginIP { get; set; }
        /// <summary>
        /// 上次登录时间
        /// </summary>
        public DateTime AdminLastLoginTime { get; set; }
        /// <summary>
        /// 上次登录地址
        /// </summary>
        [StringLength(100)]
        public string AdminLastLoginAddress { get; set; }
        public Admin()
        {
            AdminCreateTime = DateTime.Now;
            AdminLastLoginTime = DateTime.Now;
        }
    }
}
